Telegram Group & Telegram Channel
Комплексные числа в Python

Кроме уже известных вам типов int, float и подобных, в Python существует еще один довольно интересный тип, а именно, complex.

В Python комплексные числа представлены в виде x + iy. Python преобразует реальные числа x и y в комплексное с помощью функции complex(x,y).

Это число можно превратить в строку с помощью str, посчитать его модуль с помощью abs, а также для доступа к его реальной или мнимой части можно воспользоваться функциями real() и imag().

Хотя данный тип и является встроенным, для полноценной работы с комплексными операциями понадобится модуль cmath.

Подписывайтесь на канал 👉@pythonofff



tg-me.com/pythonofff/2885
Create:
Last Update:

Комплексные числа в Python

Кроме уже известных вам типов int, float и подобных, в Python существует еще один довольно интересный тип, а именно, complex.

В Python комплексные числа представлены в виде x + iy. Python преобразует реальные числа x и y в комплексное с помощью функции complex(x,y).

Это число можно превратить в строку с помощью str, посчитать его модуль с помощью abs, а также для доступа к его реальной или мнимой части можно воспользоваться функциями real() и imag().

Хотя данный тип и является встроенным, для полноценной работы с комплексными операциями понадобится модуль cmath.

Подписывайтесь на канал 👉@pythonofff

BY Python академия




Share with your friend now:
tg-me.com/pythonofff/2885

View MORE
Open in Telegram


Python академия Telegram | DID YOU KNOW?

Date: |

Telegram auto-delete message, expiring invites, and more

elegram is updating its messaging app with options for auto-deleting messages, expiring invite links, and new unlimited groups, the company shared in a blog post. Much like Signal, Telegram received a burst of new users in the confusion over WhatsApp’s privacy policy and now the company is adopting features that were already part of its competitors’ apps, features which offer more security and privacy. Auto-deleting messages were already possible in Telegram’s encrypted Secret Chats, but this new update for iOS and Android adds the option to make messages disappear in any kind of chat. Auto-delete can be enabled inside of chats, and set to delete either 24 hours or seven days after messages are sent. Auto-delete won’t remove every message though; if a message was sent before the feature was turned on, it’ll stick around. Telegram’s competitors have had similar features: WhatsApp introduced a feature in 2020 and Signal has had disappearing messages since at least 2016.

What is Telegram?

Telegram’s stand out feature is its encryption scheme that keeps messages and media secure in transit. The scheme is known as MTProto and is based on 256-bit AES encryption, RSA encryption, and Diffie-Hellman key exchange. The result of this complicated and technical-sounding jargon? A messaging service that claims to keep your data safe.Why do we say claims? When dealing with security, you always want to leave room for scrutiny, and a few cryptography experts have criticized the system. Overall, any level of encryption is better than none, but a level of discretion should always be observed with any online connected system, even Telegram.

Python академия from cn


Telegram Python академия
FROM USA